<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
if($_RQ['op']=='list'){
	$post=get_postdata();
	$list=pdo_getall('jy_meifa_store',array('uniacid'=>$_SESSION['uniacid']));
	if($list){
		foreach($list as &$item){
			//服务中订单数		
			$item['num2']=pdo_count('jy_meifa_order',array('uniacid'=>$_SESSION['uniacid'],'sid'=>$item['id'],'status'=>'1'));
			//已完成订单数
			$item['num3']=pdo_count('jy_meifa_order',array('uniacid'=>$_SESSION['uniacid'],'sid'=>$item['id'],'status'=>'2'));
			$item['lat_lng']=json_decode($item['lat_lng'],true);
			$item['juli']=cfc('tools')->getdistance($post['lng'],$post['lat'],$item['lat_lng']['lng'],$item['lat_lng']['lat']);
			$item['juli']=intval($item['juli']/1000);
			$worker_list=pdo_getall('jy_meifa_worker',array('uniacid'=>$_SESSION['uniacid'],'islock'=>'0','sid'=>$item['id']));
			paixu($worker_list,'xprice');
			$item['price']=$worker_list['0']['xprice'];
			$item['yprice']=$worker_list['0']['yprice'];
		}
	}else{
		$list = array(
			array('title'=>'深圳龙华民治店')
		);
	}
	paixu($list,'juli');
	$return['post']=$post;
	$return['list']=$list;
	$return['logo']=$basic['logo']?tomedia($basic['logo']):tomedia('../addons/jy_meiye/resource/images/logo.jpg');
	set_html('title',$return['pluginset']['title']?:'在线美发');
	exi($return);
}
